using MediatR;
using B.S.RbacData.ErrorCode;
using System.ComponentModel.DataAnnotations;

namespace SupplierCustomerManagement.Write.API.Applications.Commands.suppliers
{
    /// <summary>
    /// 修改供应商命令
    /// </summary>
    public class UpdateSupplierCommand : IRequest<ApiResult<bool>>
    {
        /// <summary>
        /// 供应商ID
        /// </summary>
        [Required(ErrorMessage = "供应商ID不能为空")]
        public int Id { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        [Required(ErrorMessage = "供应商名称不能为空")]
        [StringLength(200, ErrorMessage = "供应商名称长度不能超过200个字符")]
        public string SupplierName { get; set; } = string.Empty;

        /// <summary>
        /// 供应商类型（个人/企业）
        /// </summary>
        [Required(ErrorMessage = "供应商类型不能为空")]
        [StringLength(20, ErrorMessage = "供应商类型长度不能超过20个字符")]
        public string SupplierType { get; set; } = string.Empty;

        /// <summary>
        /// 负责人电话
        /// </summary>
        public string? ContactPhone { get; set; }

        /// <summary>
        /// 录入单位
        /// </summary>
        [Required(ErrorMessage = "录入单位不能为空")]
        [StringLength(100, ErrorMessage = "录入单位长度不能超过100个字符")]
        public string EntryUnit { get; set; } = string.Empty;

        /// <summary>
        /// 使用单位
        /// </summary>
        [Required(ErrorMessage = "使用单位不能为空")]
        [StringLength(100, ErrorMessage = "使用单位长度不能超过100个字符")]
        public string UsageUnit { get; set; } = string.Empty;

        /// <summary>
        /// 所属市场
        /// </summary>
        public string? AffiliatedMarket { get; set; }

        /// <summary>
        /// 服务人员
        /// </summary>
        public string? ServicePersonnel { get; set; }

        /// <summary>
        /// 使用状态（启用/停用）
        /// </summary>
        public string Status { get; set; } = "启用";

        /// <summary>
        /// 负责人姓名
        /// </summary>
        public string? ContactPersonName { get; set; }

        /// <summary>
        /// 身份证号（个人供应商）
        /// </summary>
        public string? IdCard { get; set; }

        /// <summary>
        /// 统一社会信用代码（企业供应商）
        /// </summary>
        public string? UnifiedSocialCreditCode { get; set; }

        /// <summary>
        /// 所属行业
        /// </summary>
        public string? Industry { get; set; }

        /// <summary>
        /// 助记码
        /// </summary>
        public string? MnemonicCode { get; set; }

        /// <summary>
        /// 供应商属性
        /// </summary>
        public string? SupplierAttribute { get; set; }

        /// <summary>
        /// 省份
        /// </summary>
        public string? Province { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        public string? City { get; set; }

        /// <summary>
        /// 区县
        /// </summary>
        public string? District { get; set; }

        /// <summary>
        /// 详细地址
        /// </summary>
        public string? DetailedAddress { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string? Remarks { get; set; }

        /// <summary>
        /// 修改人ID
        /// </summary>
        public int? UpdatedBy { get; set; }
    }
} 